var express = require('express');
var router = express.Router();


/* GET home page. */
//该文件下的/指的是根目录，从app.js中传过来的/----jw
      //app.use('/', index);--------jw
router.get('/', function(req, res, next) {
  console.log(req.session.email)
  res.render('index', {name:req.session.email});
});

router.get('/login', function(req, res, next) {
  res.render('login', { });
});

router.get('/register', function(req, res, next) {
  res.render('register', { });
});

router.get('/logout', function(req, res, next) {
  req.session.email = undefined;
  res.redirect("/login");
});


module.exports = router;
